from Cheetah.Template import Template

from jolly.datamanagement.vtkPythonDataManager import *
import inspect


def make_template(obj, classname):
    t = Template(file="model.tmpl")
    member = dict()
    func = None
    for m in inspect.getmembers(obj):
        exec "func=obj."+m[0]
        try:
            member[m[0]]=','.join(inspect.getargspec(func)[0][1:])
        except:
            pass
    t.class_label = classname
    t.class_method = member
    return t

obj = vtkPythonDataManager()
print make_template(obj, "PythonDataManager")